import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/get")
public class getTest extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //super.doGet(req, resp);
        resp.setContentType("text/html;charset=utf-8");

        // getParameter 是以字符串的形式返回参数值
        String userName = req.getParameter("userName");
        String passWord = req.getParameter("passWord");

        resp.getWriter().write("userName = "+userName+"<br>"
                +"passWord = "+passWord);
    }
}
